<template>
  <div class="app-container">
    <header-search class="g-w100 g-h100 colon mainSearchPanel">
      <el-form ref="queryForm" :inline="true">
        <el-form-item label="计划实施年度">
          <el-input v-model="queryParams.sel_jhssnd" type="number" />
        </el-form-item>
        <el-form-item label="培训任务类">
          <el-select filterable clearable placeholder="请选择" v-model="queryParams.sel_pxrwlb">
            <el-option v-for="({ sjxdm, sjxmc }, index) in xlsj1" :key="index" :label="sjxmc" :value="sjxdm">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="培训任务名称">
          <el-select filterable clearable placeholder="请选择" v-model="queryParams.sel_pxrwmc">
            <el-option v-for="({ sjxdm, sjxmc }, index) in xlsj2" :key="index" :label="sjxmc" :value="sjxdm">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item class="buttonArea">
          <el-button type="primary" icon="el-icon-search" @click="getListData"> 查询 </el-button>
          <el-button icon="el-icon-refresh" class="commonBtn" @click="resetQuery"> 重置 </el-button>
        </el-form-item>
      </el-form>
    </header-search>

    <page-panel-new class="mainListPanel">
      <el-row class="mbBottom">
        <el-col :span="16">
          <!-- <el-button type="primary" @click="doAdd('form1')"> 新增 </el-button> -->
          <span>注：红色为待提交任务。。</span>
        </el-col>
      </el-row>
      <el-table ref="table-main" :data="zbdata" height="calc(100% - 113px)" :loading="bgLoading" border>
        <!-- 状态,培训任务类别,培训任务名称,计划实施年度,计划制定人,计划制定时间,计划期计刺期,计划参加人员,计划培训地点,计划培训类型,培训内容及要求文档
        ,提交审批人,提交审批时间,审批日期,审批意见,备注 -->
        <el-table-column label="序号" type="index" width="50" />
         <el-table-column label="状态" align="center">
          <template slot-scope="scope">
            <span  style="color: red;" v-if="scope.row.lczt == '待提交'" >
              {{ scope.row.lczt }}
            </span>
            <span v-else>{{ scope.row.lczt }}</span>
          </template>
        </el-table-column>
        <el-table-column label="培训任务类别" align="center" prop="pxrwlb" show-overflow-tooltip width="180" />
        <el-table-column label="培训任务名称" align="center" prop="pxrwmc" show-overflow-tooltip width="180" />
        <el-table-column label="计划实施年度" align="center" prop="jhssnd" show-overflow-tooltip width="180" />
        <el-table-column label="计划制定人" align="center" prop="jhzdr" show-overflow-tooltip width="180" />
        <el-table-column label="计划制定时间" align="center" prop="jhzdsj" show-overflow-tooltip width="180" />
        <el-table-column label="计划制定开始时间" align="center" prop="jhpxqsrq" show-overflow-tooltip width="180" />
        <el-table-column label="参加人员" align="center" prop="cjry" show-overflow-tooltip width="180" />
        <el-table-column label="培训地点" align="center" prop="pxdd" show-overflow-tooltip width="180" />
        <el-table-column label="计划培训类型" align="center" prop="jhpxlx" show-overflow-tooltip width="180" />
        <el-table-column label="培训内容及要求文档" align="center" class-name="small-padding">
          <template slot-scope="scope">
            <span v-if="scope.row.fileid && scope.row.classid && scope.row.filename_zmcl"
              @click.stop="$bgxzfj({ classid: scope.row.classid_zmcl, fileid: scope.row.fileid_zmcl })">
              <el-link href="#" type="primary">{{ scope.row.filename_zmcl }}</el-link>
            </span>
          </template>
        </el-table-column>
        <el-table-column label="提交审批人" align="center" prop="tjspr_xm" show-overflow-tooltip width="180" />
        <el-table-column label="提交审批时间" align="center" prop="sprq" show-overflow-tooltip width="180" />
        <el-table-column label="审批日期" align="center" prop="sp_date" show-overflow-tooltip width="180" />
        <el-table-column label="审批意见" align="center" prop="spyj" show-overflow-tooltip width="180" />
        <el-table-column label="备注" align="center" prop="bz" show-overflow-tooltip width="180" />
        <el-table-column label="操作" align="center" class-name="small-padding" width="300" fixed="right">
          <template slot-scope="scope">
            <el-button type="text" class="delbutton" @click="doUpdate(scope.row, scope.$index)"> 培训实施 </el-button>
            <!-- <el-button type="text" class="delbutton" @click="doDelete(scope.row, scope.$index)"> 删除 </el-button> -->
            <el-button type="text" @click="doView(scope.row, scope.$index)"> 查看 </el-button>
            <el-button type="text" @click="scsswend(scope.row, scope.$index)">提交效果评估</el-button>
            <!-- <el-button type="text" @click="scsswend1(scope.row, scope.$index)">作废</el-button> -->
          </template>
        </el-table-column>
      </el-table>
      <qjfy :total='total' @fun="qjfyfun"></qjfy>
    </page-panel-new>


    <el-dialog :title="dialogTitle" :visible.sync="Open1" class="qjztk" append-to-body>
      <div class="el-dialog-div">
        <el-form ref="form1" :model="formData" :validate-on-rule-change=false label-width="150px"
          :disabled="formDisable">
          <div class="wgbj-2">
            <el-form-item label="培训任务类别" disabled prop="pxrwlb" :rules="[
              { required: true, message: '请输入', trigger: 'blur' },
            ]">
              <el-select v-model="formData.pxrwlb" filterable allow-create default-first-option placeholder="请选择">
                <el-option v-for="item in xlsj7" :key="item.sjxmc" :label="item.sjxmc" :value="item.sjxmc">
                </el-option>
              </el-select>
            </el-form-item>
            <el-form-item disabled label="培训任务名称" prop="pxrwmc" :rules="[
              { required: true, message: '请输入', trigger: 'blur' },
            ]">
              <el-input v-model="formData.pxrwmc" />
            </el-form-item>
            <el-form-item label="培训起始时间" prop="jhpxqsrq" :rules="[
              { required: true, message: '请输入', trigger: 'blur' },
            ]">
              <el-date-picker v-model="formData.jhpxqsrq" type="date" placeholder="选择日期" format="yyyy-MM-dd"
                value-format="yyyy-MM-dd" />
            </el-form-item>
            <el-form-item label="培训结束时间" prop="jhpxjsrq" :rules="[
              { required: true, message: '请输入', trigger: 'blur' },
            ]">
              <el-date-picker v-model="formData.jhpxjsrq" type="date" placeholder="选择日期" format="yyyy-MM-dd"
                value-format="yyyy-MM-dd" />
            </el-form-item>
            <el-form-item label="培训地点">
              <el-select v-model="formData.pxdd" filterable allow-create default-first-option placeholder="请选择">
                <el-option v-for="item in xlsj4" :key="item.sjxmc" :label="item.sjxmc" :value="item.sjxmc">
                </el-option>
              </el-select>
            </el-form-item>

            <el-form-item label="参加人员" prop="cjry" :rules="[
              { required: true, message: '请输入', trigger: 'blur' },
            ]">
              <el-select v-model="formData.cjry" multiple filterable allow-create default-first-option
                placeholder="请选择">
                <el-option v-for="item in xlsj5" :key="item.sjxmc" :label="item.sjxmc" :value="item.sjxdm">
                </el-option>
              </el-select>
            </el-form-item>

          </div>

          <!-- <el-col :span="24" v-if="!formDisable">
            <el-form-item class="wenddd" label="工作要求文档">
              <el-upload ref="upload" :limit="1" action="" :auto-upload="false" drag :file-list="dgfjwj.uploadFiles"
                name="upfile" :on-change="handleUploadChange_d" :on-remove="handleUploadRemove_d"
                :before-remove="handleUploadBeforeRemove_d">
                <i class="el-icon-upload" />
                <div class="el-upload__text">将文件拖到此处，或<em>点击上传</em></div>
              </el-upload>
            </el-form-item>
          </el-col> -->

          <el-form-item label="备注">
            <el-input v-model="formData.bz" type="textarea" :rows="4" />
          </el-form-item>
        </el-form>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button v-if="!formDisable" type="primary" @click="doSubmit"> 保存 </el-button>
        <el-button class="cancelBtn" @click="doClose"> 关 闭 </el-button>
      </div>
    </el-dialog>
    <el-dialog title="提交效果评估" :visible.sync="Open2"  class="qjxtk" append-to-body>
      <div class="el-dialog-div">
        <el-form ref="form2" :model="formData" :validate-on-rule-change=false label-width="120px"
          :disabled="formDisable">
          <el-form-item label="效果评估人">
            <el-select v-model="formData.xgpgr" prop="xgpgr" :rules="[
              { required: true, message: '请输入', trigger: 'blur' },
            ]" filterable allow-create default-first-option placeholder="请选择">
              <el-option v-for="({ sjxdm, sjxmc }, index) in xlsj3" :key="index" :label="sjxmc" :value="sjxdm">
              </el-option>
            </el-select>
          </el-form-item>
        </el-form>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button v-if="!formDisable" type="primary" @click="doSubmit1"> 保存 </el-button>
        <el-button class="cancelBtn" @click="doClose1"> 关 闭 </el-button>
      </div>
    </el-dialog>
    <el-dialog title="作废" :visible.sync="Open3"  class="qjztk" append-to-body>
      <div class="el-dialog-div">
        <el-form ref="form3" :model="formData" :validate-on-rule-change=false label-width="120px"
          :disabled="formDisable">
          <el-form-item label="备注">
            <el-input v-model="formData.zfyy" type="textarea" :rows="4" />
          </el-form-item>
        </el-form>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button v-if="!formDisable" type="primary" @click="doSubmit2"> 保存 </el-button>
        <el-button class="cancelBtn" @click="doClose2"> 关 闭 </el-button>
      </div>
    </el-dialog>
    <qjckfj ref="ckfj"></qjckfj>
  </div>
</template>
<script lang="ts">
import Vue from 'vue'
import dayjs from 'dayjs'
export default Vue.extend({
  name: 'ygxxgl-rypx-pxjh',
  data() {
    return {
      title: '培训实施', //页面标题
      jklj: 'ygxxgl/rypx/pxss', // 接口路径
      dialogTitle: '', // 弹框标题
      bgLoading: false, // 表格加载状态
      Open1: false, //弹框状态
      Open2: false, //弹框状态
      Open3: false, //弹框状态
      zbdata: [], //主表格数据
      xlsj1: [],//查询选择器 下拉数据
      xlsj2: [],//查询选择器 下拉数据
      xlsj3: [],//查询选择器 下拉数据
      xlsj4: [],//查询选择器 下拉数据
      xlsj5: [],//查询选择器 下拉数据
      xlsj6: [],//查询选择器 下拉数据
      xlsj7: [],//查询选择器 下拉数据

      optype: 'xz', //操作类型
      formData: {
        "cjry": "",
        "lczt": "",
        "pxyq_cnt": "",
        "jhssnd": "",
        "ssqsrq": "",
        "xgpgr": "",
        "jhpxdd": "",
        "pxrwmc": "",
        "jhzdr": "",
        "tjspr_xm": "",
        "xgpgyj": "",
        "jhpxqsrq": "",
        "tjspsj": "",
        "bz": "",
        "s_zhxgr": "",
        "id": "",
        "spyj": "",
        "jhpxlx": "",
        "xgpg": "",
        "s_cjr": "",
        "qtry": "",
        "jhzdr_xm": "",
        "spr_xm": "",
        "jhcjry": "",
        "xgpgr_xm": "",
        "pxcl_cnt": "",
        "sprq": "",
        "jhzdsj": "",
        "tjspr": "",
        "ssjsrq": "",
        "pxrwlb": "",
        "s_cjsj": "",
        "spr": "",
        "zfyy": "",
        "xgpg_cnt": "",
        "s_zhxgsj": "",
        "pxdd": "",
        "jhpxjsrq": ""
      }, //录入Form数据

      formDisable: false, //表单禁用状态
      queryParams: {
        "tjspr_xm": "",
        "tjspsj": "",
        "spyj": "",
        "spr_xm": "",
        "sprq": "",
        "tjspr": "",
        "spr": "",
        start: 0,
        limit: 20,
      }, //查询参数
      total: 0,
      dgfjwj: {  //上传配置
        uploadFiles: [], //已上传文件列表
      },
      hdfjwj: {  //上传配置
        uploadFiles: [], //已上传文件列表
      }
    }
  },
  computed: {
  },
  watch: {
    optype: {
      handler(newVal, oldVal) {
        if (newVal == 'ck') {
          this.formDisable = true;
        } else {
          this.formDisable = false;
        }
      },
      deep: true,
    },
    queryParams: {
      handler(newVal, oldVal) {
        this.getxlsj1();
      },
      deep: true,
    },

  },
  mounted() {
    this.getListData();
    this.getxlsj1();
  },
  methods: {
    czcxfun() { // 清空表单
      this.formData = {
        "cjry": "",
        "lczt": "",
        "pxyq_cnt": "",
        "jhssnd": "",
        "ssqsrq": "",
        "xgpgr": "",
        "jhpxdd": "",
        "pxrwmc": "",
        "jhzdr": "",
        "tjspr_xm": "",
        "xgpgyj": "",
        "jhpxqsrq": "",
        "tjspsj": "",
        "bz": "",
        "s_zhxgr": "",
        "id": "",
        "spyj": "",
        "jhpxlx": "",
        "xgpg": "",
        "s_cjr": "",
        "qtry": "",
        "jhzdr_xm": "",
        "spr_xm": "",
        "jhcjry": "",
        "xgpgr_xm": "",
        "pxcl_cnt": "",
        "sprq": "",
        "jhzdsj": "",
        "tjspr": "",
        "ssjsrq": "",
        "pxrwlb": "",
        "s_cjsj": "",
        "spr": "",
        "zfyy": "",
        "xgpg_cnt": "",
        "s_zhxgsj": "",
        "pxdd": "",
        "jhpxjsrq": ""
      }
      this.dgfjwj.uploadFiles = [];
      this.hdfjwj.uploadFiles = [];
    },
    resetQuery() {  //查询参数重置按钮事件
      this.queryParams = {
        "tjspr_xm": "",
        "tjspsj": "",
        "spyj": "",
        "spr_xm": "",
        "sprq": "",
        "tjspr": "",
        "spr": "",
        start: 0,
        limit: 20,
      }
      this.getListData()
    },
    getxlsj1() { //获取 选择器数据
      try {
        const param = {
          p_qsrq: this.queryParams.sel_qsrq,
          p_jzrq: this.queryParams.sel_jzrq,
        };
        this.$getSelectorData("pxrwlb", this.queryParams, this.jklj).then((res) => {
          this.xlsj1 = res.success ? res.rows : []
        })
        this.$getSelectorData("pxrwmc", this.queryParams, this.jklj).then((res) => {
          this.xlsj2 = res.success ? res.rows : []
        })
        // this.$getSelectorData("in_zdr", this.queryParams, this.jklj).then((res) => {
        //   this.xlsj3 = res.success ? res.rows : []
        // })
        this.$getSelectorData("in_pxdd", this.queryParams, this.jklj).then((res) => {
          this.xlsj4 = res.success ? res.rows : []
        })
        this.$getSelectorData("in_cjry",{p_type: 'unselected'}, this.jklj).then((res) => {
          this.xlsj5 = res.success ? res.rows : []
        })
        // this.$getSelectorData("in_tjspr", this.queryParams, this.jklj).then((res) => {
        //   this.xlsj6 = res.success ? res.rows : []
        // })
        // this.$getSelectorData("in_pxrwlb", this.queryParams, this.jklj).then((res) => {
        //   this.xlsj7 = res.success ? res.rows : []
        // })
        // this.$getSelectorData("in_jhpxlx", this.queryParams, this.jklj).then((res) => {
        //   this.xlsj8 = res.success ? res.rows : []
        // })

      } catch (error) {
        console.warn('接口提示', error)
      }
    },
    qjfyfun(e) {//分页
      this.queryParams.start = e.start;
      this.queryParams.limit = e.limit;
    },
    sjfwfun(e, e1) {//日期范围选择器事件
      this.queryParams.sel_qsrq = e;
      this.queryParams.sel_jzrq = e1;
    },
    handleUploadChange_d(file, filelist) { //上传文件改变事件
      var _fileData = new FormData();
      _fileData.append("bizPath", "syfxxt/khfw");
      _fileData.append("uploadType", "minio");
      _fileData.append("file", file.raw, file.name);
      this.$uploadFile(_fileData).then((res) => {
        if (res.data.code === 200) {
          file.minioID = res.data.data.split(":")[0];
          file.filename = file.name;
          this.dgfjwj.uploadFiles = filelist;
        } else {
          this.$message.error({ content: '上传失败!', placement: 'center' })
          filelist.splice(filelist.indexOf(file), 1);
          this.dgfjwj.uploadFiles = filelist;
        }
      })
        .catch(() => {
          this.$message.error({ content: '上传失败!', placement: 'center' });
          filelist.splice(filelist.indexOf(file), 1);
          this.dgfjwj.uploadFiles = filelist;
        });
    },
    handleUploadChange_h(file, filelist) {
      var _fileData = new FormData();
      _fileData.append("bizPath", "syfxxt/khfw");
      _fileData.append("uploadType", "minio");
      _fileData.append("file", file.raw, file.name);
      this.$uploadFile(_fileData).then((res) => {
        if (res.data.code === 200) {
          file.minioID = res.data.data.split(":")[0];
          file.filename = file.name;
          this.hdfjwj.uploadFiles = filelist;
        } else {
          this.$message.error({ content: '上传失败!', placement: 'center' })
          filelist.splice(filelist.indexOf(file), 1);
          this.hdfjwj.uploadFiles = filelist;
        }
      })
        .catch(() => {
          this.$message.error({ content: '上传失败!', placement: 'center' });
          filelist.splice(filelist.indexOf(file), 1);
          this.hdfjwj.uploadFiles = filelist;
        });
    },
    handleUploadBeforeRemove_d(file) {//上传文件删除前事件
      if (file.fileid && file.fjid) {
        return this.$modal.confirm("该文件已上传，确认删除该文件？");
      } else {
        return true;
      }
    },
    handleUploadBeforeRemove_h(file, filelist) {
      if (file.fileid && file.fjid) {
        return this.$modal.confirm("该文件已上传，确认删除该文件？");
      } else {
        return true;
      }
    },
    handleUploadRemove_d(file, filelist) {//上传文件删除事件
      this.dgfjwj.uploadFiles = filelist;
      if (file.fileid && file.id) {
        this.$submit_delfile({ fileid: file.fileid, id: file.id }, this.jklj)
          .then((res) => {
            if (res.success) {
              this.$message.success({ content: '删除成功!', placement: 'center' })
            } else {
              this.$message.error({ content: '删除失败!', placement: 'center' })
            }
          })
          .catch(() => {
            this.$message.error({ content: '删除失败!', placement: 'center' })
          });
      }
    },
    handleUploadRemove_h(file, filelist) {
      this.hdfjwj.uploadFiles = filelist;
      if (file.fileid && file.fjid) {
        this.$submit_delfile_fj({ fileid: file.fileid, fjid: file.fjid, tzggid: this.formData.id }, this.jklj)
          .then((res) => {
            if (res.success) {
              this.$message.success({ content: '删除成功!', placement: 'center' })
            } else {
              this.$message.error({ content: '删除失败!', placement: 'center' })
            }
          })
          .catch(() => {
            this.$message.error({ content: '删除失败!', placement: 'center' })
          });
      }
    },
    getListData() { //获取主表格查询数据
      try {
        this.bgLoading = true
        this.$getListData(this.queryParams, this.jklj).then((res) => {
          if (res.success) {
            this.zbdata = res.rows;
            this.total = res.total;
          } else {
            this.zbdata = []
            this.$message.error({ content: '请重新搜索!', placement: 'center' })
          }
        })
      } catch (error) {
        this.bgLoading = false;
        console.warn('接口提示', error);
      }
    },
    doSubmit() {//处理保存按钮事件
      this.$refs['form1'].validate((valid) => {
        if (valid) {
          var _data = { optype: 'update', id: this.formData.id,pxrwlb: this.formData.pxrwlb,pxrwmc: this.formData.pxrwmc,ssqsrq:this.formData.jhpxqsrq,ssjsrq:this.formData.jhpxjsrq,
            pxdd: this.formData.pxdd,cjry: this.formData.cjry,bz: this.formData.bz
           };
          var _submitData = new FormData();
          for (let key in _data) {
            if (_data[key] && _data[key] instanceof Date) {
              _data[key] = dayjs(_data[key]).format('YYYY-MM-DD');
            }
            _submitData.append(key, _data[key]);
          }
          var _fileList_fj = [];
          var _fileList = [];
          if (this.hdfjwj && this.hdfjwj.uploadFiles) {
            this.hdfjwj.uploadFiles.forEach(file => {
              if (file.status == 'ready' && file.minioID) {
                _fileList_fj.push(file);
              }
            });
          }
          if (this.dgfjwj && this.dgfjwj.uploadFiles) {
            this.dgfjwj.uploadFiles.forEach(file => {
              if (file.status == 'ready' && file.minioID) {
                _fileList.push(file);
              }
            });
          }
          // _submitData.append("upfile", JSON.stringify(_fileList));
          this.$submit(_submitData, this.jklj)
            .then((res) => {
              if (res.success) {
                this.$message.success({ content: '保存成功!', placement: 'center' })
                this.Open1 = false;
                this.Open2 = false;
                this.Open3 = false;
                this.getListData()
                this.getxlsj1()
              } else {
                this.$message.error({ content: '保存失败!', placement: 'center' })
              }
            })
            .catch(() => {
              this.$message.error({ content: '保存失败!', placement: 'center' })
            });
        }
      });
    },
    doSubmit1() {
      this.$refs['form2'].validate((valid) => {
        if (valid) {
          var _data = { optype: 'update', id: this.formData.id, xgpgr: this.formData.xgpgr };
          var _submitData = new FormData();
          for (let key in _data) {
            if (_data[key] && _data[key] instanceof Date) {
              _data[key] = dayjs(_data[key]).format('YYYY-MM-DD');
            }
            _submitData.append(key, _data[key]);
          }
          var _fileList_fj = [];
          if (this.hdfjwj && this.hdfjwj.uploadFiles) {
            this.hdfjwj.uploadFiles.forEach(file => {
              if (file.status == 'ready' && file.minioID) {
                _fileList_fj.push(file);
              }
            });
          }

          this.$submit_qt(_submitData, this.jklj, 'tjxgpg')
            .then((res) => {
              if (res.success) {
                this.$message.success({ content: '保存成功!', placement: 'center' })
                this.Open1 = false;
                this.Open2 = false;
                this.Open3 = false;
                this.getListData()
                this.getxlsj1()
              } else {
                this.$message.error({ content: '保存失败!', placement: 'center' })
              }
            })
            .catch(() => {
              this.$message.error({ content: '保存失败!', placement: 'center' })
            });
        }
      });
    },
    doSubmit2() {
      this.$refs['form3'].validate((valid) => {
        if (valid) {
          var _data = { optype: 'update', id: this.formData.id, zfyy: this.formData.zfyy };
          var _submitData = new FormData();
          for (let key in _data) {
            if (_data[key] && _data[key] instanceof Date) {
              _data[key] = dayjs(_data[key]).format('YYYY-MM-DD');
            }
            _submitData.append(key, _data[key]);
          }
          var _fileList_fj = [];
          if (this.hdfjwj && this.hdfjwj.uploadFiles) {
            this.hdfjwj.uploadFiles.forEach(file => {
              if (file.status == 'ready' && file.minioID) {
                _fileList_fj.push(file);
              }
            });
          }
          this.$submit_qt(_submitData, this.jklj, 'discard')
            .then((res) => {
              if (res.success) {
                this.$message.success({ content: '保存成功!', placement: 'center' })
                this.Open1 = false;
                this.Open2 = false;
                this.Open3 = false;
                this.getListData()
                this.getxlsj1()
              } else {
                this.$message.error({ content: '保存失败!', placement: 'center' })
              }
            })
            .catch(() => {
              this.$message.error({ content: '保存失败!', placement: 'center' })
            });
        }
      });
    },

    doAdd(formName) {//处理新增按钮事件
      this.Open1 = true;
      this.optype = 'xz';
      this.czcxfun();
      this.formData.optype = 'add';
      this.dialogTitle = this.title + ' >> 新增';
    },
    doUpdate(row) {//处理修改按钮事件
      this.czcxfun();
      this.xzsj = row;
      this.Open1 = true;
      this.optype = 'xg';
      this.dialogTitle = this.title + ' >> 修改';
      this.formData = { ...row };
      this.formData.optype = 'update';
      
      // const param1 = {
      //   start: 0,
      //   limit: 100,
      //   fileid: this.formData.fileid,
      // };
      // this.$getListData(param1, this.jklj).then((res) => {
      //   if (res.success) {
      //     if (res.rows[0].fileid) {
      //       this.dgfjwj.uploadFiles = res.rows;
      //       this.dgfjwj.uploadFiles.forEach(file => {
      //         file.name = file.filename;
      //         file.status = 'success';
      //       });
      //     } else {
      //       this.dgfjwj.uploadFiles = [];
      //     }
      //   } else {
      //     this.dgfjwj.uploadFiles = []
      //     this.$message.error({ content: '请重新搜索!', placement: 'center' })
      //   }
      // })
    },
    doUpdate1(row) {//
      // if (row.lczt !== '待接收') {
      //   this.$message.error({ content: '该工作已被接收!', placement: 'center' })
      //   return
      // }
      const param = {
        gzjsr: localStorage.getItem('current_user_name'),
        id: row.id,
      };
      return this.$modal.confirm("是否确认？")
        .then(() => {
          this.$submit_qtsj(param, this.jklj, 'gzjs')
            .then((res) => {
              if (res.success) {
                this.getListData()
                this.$message.success({ content: '成功!', placement: 'center' })
              } else {
                this.$message.error({ content: '失败!', placement: 'center' })
              }
            })
            .catch(() => {
              this.$message.error({ content: '失败!', placement: 'center' })
            });
        })
        .catch(() => {
        });
    },
    scsswend(row) {//上传实施文档
      // if (row.lczt == '待接收') {
      //   this.$message.error({ content: '工作还未接收!', placement: 'center' })
      //   return
      // }
      this.Open2 = true;
      this.czcxfun();
      this.xzsj = row;
      this.optype = 'xg';
      this.formData = { ...row };
      this.formData.optype = 'update';
    },
    scsswend1(row) {//上传实施文档
     
      this.Open3 = true;
      this.czcxfun();
      this.xzsj = row;
      this.optype = 'xg';
      this.formData = { ...row };
      this.formData.optype = 'update';
    },
    doDelete(row) {//处理删除按钮事件
      return this.$modal.confirm("是否确认删除该条数据？")
        .then(() => {
          this.$submit_delete({ id: row.id }, this.jklj)
            .then((res) => {
              if (res.success) {
                this.getListData()
                this.$message.success({ content: '删除成功!', placement: 'center' })
              } else {
                this.$message.error({ content: '删除失败!', placement: 'center' })
              }
            })
            .catch(() => {
              this.$message.error({ content: '删除失败!', placement: 'center' })
            });
        })
        .catch(() => {
        });
    },
    doView(row) {//处理查看按钮事件
      this.Open1 = true;
      this.optype = 'ck';
      this.dialogTitle = this.title + ' >> 查看';
      this.formData = { ...row };
    },
    doViewFJ(row) {//处理查看附件按钮事件
      this.$refs.ckfj.dkfj({ start: 0, limit: 100, set_lsgzid: row.id, }, this.jklj);
    },
    doClose() {//处理关闭事件
      this.Open1 = false;
    },
    doClose1() {//处理关闭事件
      this.Open2 = false;
    },
    doClose2() {//处理关闭事件
      this.Open3 = false;
    },
  },
})
</script>
<style lang="less" scoped>
.app-container {
  height: 100%;
}

::v-deep .el-dialog__body {
  max-height: 60vh;
  overflow-y: auto;
}



::v-deep .el-input.is-disabled .el-input__inner,
::v-deep .el-textarea.is-disabled .el-textarea__inner,
::v-deep .el-radio.is-disabled .el-radio__inner,
::v-deep .el-radio.is-disabled .el-radio__label,
::v-deep .el-checkbox.is-disabled .el-checkbox__inner,
::v-deep .el-checkbox.is-disabled .el-checkbox__label {
  background-color: #f6f6f6 !important;
  /* 示例：改变背景颜色 */
  color: #333 !important;
  /* 示例：改变文字颜色 */
}

::v-deep .el-upload.el-upload--text {
  margin: 0 !important;
}

.mainSearchPanel .page-header-title {
  font-size: 16px;
  color: #409EFF;
  font-weight: bolder;
  display: block;
  margin: 0;
  padding: 0;
  margin: 10px 0;
}

.mainSearchPanel .el-divider--horizontal {
  margin: 0 !important;
  margin-top: 10px;
}
</style>
